package nrrg.zhujuxing.application.learnscala

object closure {
  def main(args: Array[String]): Unit = {
    def addWithParameter(a: Int): Int => Int = {
      def add(b: Int): Int = {
        a + b
      }

      add
    }

    println(addWithParameter(1)(2))


    def curryingExample(a: Int)(b: Int): Int = {
      a + b
    }
    print(curryingExample(1)(2))
  }

}
